﻿@model CollectBeans.Model.Quiz

@{
    ViewBag.Title = "Create";
}

<h2>Create</h2>

@using (Html.BeginForm()) {
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

     <fieldset>
        <legend>Quiz</legend>

        <div class="editor-label">
            问题：
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Question)
            @Html.ValidationMessageFor(model => model.Question)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Example)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Example)
            @Html.ValidationMessageFor(model => model.Example)
        </div>

        <div class="editor-label">
            问题类型：
        </div>
        <div class="editor-field">
            @{
                 List<SelectListItem> Html_type = new List<SelectListItem>();
                 Html_type.Add(new SelectListItem { Text = "--问题类型--", Value = "0", Selected = true });
                 foreach (object e in Enum.GetValues(typeof(CollectBeans.Portal.Models.Enums.Htmltype)))
                    {
                        Html_type.Add(new SelectListItem { Text = Enum.GetName(typeof(CollectBeans.Portal.Models.Enums.Htmltype), e), Value = ((int)e).ToString() });
                    }
                       @Html.DropDownList("htmltype", Html_type);
                 }
        </div>

        <div class="editor-label">
            幽默集：
        </div>
        <div class="editor-field">
            @{
                 List<SelectListItem> myCategory = new List<SelectListItem>();
                 myCategory.Add(new SelectListItem { Text = "--幽默集--", Value = "0", Selected = true });
                 foreach (object e in Enum.GetValues(typeof(CollectBeans.Portal.Models.Enums.Category)))
                    {
                        myCategory.Add(new SelectListItem { Text = Enum.GetName(typeof(CollectBeans.Portal.Models.Enums.Category), e), Value = ((int)e).ToString() });
                    }
                       @Html.DropDownList("Category", myCategory);
                 }
        </div>

        <div class="editor-label">
            幽默集编册号
        </div>
        <div class="editor-field">
            @{
                 List<SelectListItem> mySerialnumber = new List<SelectListItem>();
                 mySerialnumber.Add(new SelectListItem { Text = "--鞭策号--", Value = "0", Selected = true });
                 foreach (object e in Enum.GetValues(typeof(CollectBeans.Portal.Models.Enums.Serialnumber)))
                    {
                        mySerialnumber.Add(new SelectListItem { Text = Enum.GetName(typeof(CollectBeans.Portal.Models.Enums.Serialnumber), e), Value = ((int)e).ToString() });
                    }
                       @Html.DropDownList("Serialnumber", mySerialnumber);
                 }
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Index)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Index)
            @Html.ValidationMessageFor(model => model.Index)
        </div>

        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
    
    
    @*<fieldset>
        <legend>Quiz</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.Question)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Question)
            @Html.ValidationMessageFor(model => model.Question)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Example)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Example)
            @Html.ValidationMessageFor(model => model.Example)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Htmltype)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Htmltype)
            @Html.ValidationMessageFor(model => model.Htmltype)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Category)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Category)
            @Html.ValidationMessageFor(model => model.Category)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Serialnumber)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Serialnumber)
            @Html.ValidationMessageFor(model => model.Serialnumber)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Index)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Index)
            @Html.ValidationMessageFor(model => model.Index)
        </div>

        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>*@
    
    
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
